const { defineConfig } = require("@vue/cli-service");
//console.log(process.env);
let baseURL=process.env.VUE_APP_BASEURL
console.log(baseURL);
let env=process.env.NODE_ENV
console.log('当前环境是'+process.env.VUE_APP_ENV);
module.exports = defineConfig({
  publicPath: ".",//资源不去 根目录拿，从相对路径去拿
  outputDir: env==="test"? "testDist":"dist",
  transpileDependencies: true,
  lintOnSave: false,
  //配置代理
  devServer: {
    proxy: {
      "/api": {
        target: baseURL,
        pathRewrite: {
          "^/api": ""
        }
      } 
    }
  }
});
